{include file="public/header" /}
<style>
    .flex-layout input{
        height: 30px;
        line-height: 30px;
        text-align: right;
        padding-right: 5px;
    }
    .layui-form-danger:focus {
        box-shadow: 0 0 0 2px var(--bc);
    }
    .buyout{
        position: fixed;
        line-height: 45px;
        text-align: center;
        color: var(--cl);
        font-size: 15px;
        bottom: 15px;
        width: 80%;
        left: 10%;
        height: 45px;
        border-radius: 20px;
        background: linear-gradient(to right ,rgb(254,129,1), rgb(235,29,35));
    }
    .recharge-nav li {
        width: auto !important;
        height: auto !important;
        padding: 10px !important;
        flex-direction: unset !important;
    }
    .recharge-nav li p:nth-child(2){
        line-height: 1.25rem !important;
        margin-left: 5px !important;margin-top: -2px;
    }
    .recharge-title{
        padding: 0px !important;
    }
    .recharge-imgs,.recharge-bank{
        margin: 0.9375rem 0 0 !important;
        display: block;
    }
    #image_shows{
        width: 100%;
        display:  block !important;
        height: auto !important;
        margin-top: 10px;
    }
    #image_shows img{
        float: left;
        width: 5.875rem;
        height: 5.875rem;
        margin: 5px;
    }
    #uploads_images p{
        position: relative;
    }
    .close-img{
        position: absolute;
    }
    .layui-icon-close-fill{
        position: absolute;
        top: -5px;
        right: -5px;
        font-size: 26px;
    }
</style>
<body class="hide-top bgc">
    <div class="draw-container">
        <img src="/static/index/img/icon16.png" alt="">
        <div class="draw-content">
            <form action="{:url('deal/pay')}" method="post" class="form layui-form">
                <div class="submit-hd flex-center">
                    <i class="layui-icon layui-icon-left"></i>支付
                </div>
                <input type="hidden" value="{$pay_list?$pay_list[0]['title']:''}" id="pay_way" name="pay_way"/>
                <input type="hidden" name="id" value="{$Request.param.id?:''}"/>
                <div class="draw-account-news">
                    <div class="flex-layout">卖家编号
                        <input type="text"  value="{$info?$info.user.code:''}"  readonly>
                    </div>
                    <div class="flex-layout">卖家姓名
                        <input type="text"  value="{$info?$info.user.nickname:''}" readonly>
                    </div>
                    <div class="flex-layout">卖家电话
                        <input type="text"  value="{$info?$info.user.mobile:''}" readonly>
                    </div>
                    <div class="flex-layout">购买数量
                        <input type="nember" value="{$info?$info.num:''}" readonly>
                    </div>
                    <div class="flex-layout">打款金额
                        <input type="text" value="{$info?$info.money:''}" readonly>
                    </div>
                </div>
                <div class="draw-account-news">
                    <div class="recharge-title">支付方式</div>
                    <ul class="recharge-nav flex-layout" style="margin: 0px !important;">
                        {volist name="pay_list" id="pay" key="k"}
                        <li {if $k == 1} class="active" {/if} data-type="{$pay.title}">
                            <p class="flex-center">
                                <img src="{$pay.icon}" alt="">
                            </p>
                            <p>{$pay.title}</p>
                            <img src="/static/index/img/icon22.png" alt="" class="{if $k != 1} check-img{/if} img">
                        </li>
                        {/volist}
                    </ul>
                    {volist name="pay_list" id="pay" key="k"}
                        {if $pay.title != '银行卡' }
                        <div class="recharge-imgs {$pay.class} flex-center" {if $k != 1} style="display: none" {/if}>
                            <p class="flex-center">
                                <img class="images" src="{$pay.img}" alt="">
                            </p>
                            <p>请扫码支付</p>
                        </div>
                        {else}
                        <div class="{$pay.class}"  {if $k != 1} style="display: none" {/if}>
                            <p><span>
                                    <span class="copy_content">{$pay.code[0]??""}<br/>{$pay.code[1]??""}<br/>{$pay.code[2]??""}<br/>{$pay.code[3]??""}<br/></span>
                                    <span class="copy" data-clipboard-action="copy" data-clipboard-target=".copy_content"
                                          style="color: red">复制</span>
                                </span></p>
                        </div>
                        {/if}
                    {/volist}
                    <ul class="recharge-acc-list" style="padding: 0px;">
                        <li>
                            <p>打款截图</p>
                            <div id="image_shows">
                            </div>
                            <label id="uploads_images">
                                <img src="/static/index/img/icon15.png" alt="">
                            </label>
                            <input type="hidden" name="images" id="images_values" value="" lay-verify="required"
                                   lay-reqtext="请上传支付凭证"
                                   placeholder="请上传支付凭证"/>
                                   <div style="clear: both;"></div>
                        </li>
                    </ul>
                    <div class="flex-layout">支付密码
                        <input type="password" lay-verify="required" lay-reqtext="请输入支付密码" lay-verType="tips"
                               name="pay_password" placeholder="请输入支付密码" >
                    </div>
                </div>
                <div style="height: 80px;"></div>
                <p class="buyout" lay-submit lay-filter="save" formObj=".form">确认打款</p>
            </form>
        </div>
    </div>
</body>
{include file="public/footer"/}
<script src="/static/index/js/clipboard.min.js"></script>
<script>
    $('.recharge-imgs .images').click(function () {
        DataHtml('收款码', $(this).attr('src'))
    });
    $('.copy').click(function () {
        var clipboard = new ClipboardJS('.copy');
        layer.msg('已复制');
    })
    $('.recharge-nav li').click(function (e) {
        var pay_way = e.currentTarget.dataset.type;
        if (pay_way == '银行卡') {
            $('.recharge-bank').show()
            $('.alipay').hide()
            $('.wechat').hide()
        } else if (pay_way == '支付宝') {
            $('.alipay').show()
            $('.wechat').hide()
            $('.recharge-bank').hide()
        } else {
            $('.alipay').hide()
            $('.wechat').show()
            $('.recharge-bank').hide();
        }
        $("#pay_way").val(pay_way);
        $(this).addClass('active').siblings().removeClass('active')
        $(this).find('.img').show().parent().siblings().find('.img').hide()
    })

    function DataHtml(name, url) {
        $("#displayimg").attr("src", url);
        var height = $("#displayimg").height();
        var width = $("#displayimg").width();
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            shadeClose: true,
            area: [width + 'px', 'auto'], //宽高
            content: "<img style='width: 100%' alt=" + name + " title=" + name + " src=" + url + " />"
        });
    }
</script>
</html>